package com.example.test_activity.utils;

import android.util.Log;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.IOException;

/**
 * 待做
 * 选课
 * Created by 旭 on 2017/3/17/017.
 */

public class GetCourse {
    //网上选课
    final String string = "http://jwxt.cisau.com.cn:9090/xkAction.do?actionType=-1&fajhh=847";
    //系任选课
    final String url_1 = "http://jwxt.cisau.com.cn:9090/xkAction.do?actionType=4&pageNumber=-1";
    //校任选课
    final String url_2 = "http://jwxt.cisau.com.cn:9090/xkAction.do?actionType=3&pageNumber=-1";
    //自由选课
    final String url_3 = "http://jwxt.cisau.com.cn:9090/xkAction.do?actionType=5&pageNumber=-1&cx=ori";
    //培养方案
    final String url_4 = "http://jwxt.cisau.com.cn:9090/xkAction.do?actionType=2&pageNumber=";

    String error;

    //培养方案
    public String getUrl_4(String html) {

            Document document = Jsoup.parse(html);

            Elements elements = document.select(".errorTop");
            if (elements.isEmpty())
            {
                return null;
            }

            Element e = elements.get(0);

            Log.e("选课", e.text());
            error = e.text();

        return error;
    }
}
